package com.Thread.Demo8;

/**
 * @ClassName User
 * @Description TODO
 * @Author Kx
 * @Date 2025/3/12 19:10
 * @Version 1.0
 */
public class User extends Thread{
    private String name;
    private Printer printer;

    public User(String name, Printer printer){
        this.name = name;
        this.printer = printer;
    }

    public User(String name,Printer printer,String name1){
        super(name1);
        this.name = name;
        this.printer = printer;
    }

    @Override
    public void run() {
        printer.print(name,"hello");
    }
}
